import axios from '@/libs/request/axios'
import QS from 'qs';
//  查询合同关闭列表数据
export const findContractCloseList = (params) => {
    return axios.request({
        url: `/contractManage/contractClose/findContractCloseList`,
        method: 'POST',
        data: params,
    })
};

// 获取保险信息数据
export const findcontractOverpayment = (contractNo) => {
    return axios.request({
        url: '/contractManage/contractClose/findByIdDetails',
        data: QS.stringify({contractNo: contractNo}, {arrayFormat: 'repeat'}),
        method: 'post',
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
}

// 保存合同关闭信息
export const submitDetails = (params) => {
    return axios.request({
        url: `/contractManage/contractClose/submit`,
        method: 'POST',
        data: params,
    })
};

// 根据合同号查询差额租金信息
export const getAssetsRepaymentList = (contractNo) => {
    return axios.request({
        url: `/contractBasic/assetsRepaymentPlan/getAssetsRepaymentList`,
        method: 'POST',
        data: QS.stringify({contractNo: contractNo}, {arrayFormat: 'repeat'}),
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
};
// 根据合同号查询差额费用信息
export const getExpenseRecordList = (contractNo) => {
    return axios.request({
        url: `/contractBasic/expenseRecord/getExpenseList`,
        method: 'POST',
        data: QS.stringify({contractNo: contractNo}, {arrayFormat: 'repeat'}),
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
};
// 根据合同号查询差额逾期利息信息
export const getPenaltyInterestList = (contractNo) => {
    return axios.request({
        url: `/contractBasic/penaltyInterest/getPenaltyList`,
        method: 'POST',
        data: QS.stringify({contractNo: contractNo}, {arrayFormat: 'repeat'}),
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
};

// 根据合同号查询溢缴款信息
export const getReceiptRecord = (contractNo) => {
    return axios.request({
        url: `/contractBasic/receiptHandle/getReceiptList`,
        method: 'POST',
        data: QS.stringify({contractNo: contractNo}, {arrayFormat: 'repeat'}),
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    })
};
// 提交合同关闭信息
export const submitOverpayment = (params) => {
    return axios.request({
        url: '/contractManage/contractClose/submitOverpayment',
        data: params,
        method: 'post'
    })
};
// 保存合同关闭审批信息
export const approveOverpayment = (params) => {
    return axios.request({
        url: '/contractManage/contractClose/approveOverpayment',
        data: params,
        method: 'post'
    })
};
// 合同关闭
export const closeContract = (params) => {
    return axios.request({
        url: '/contractManage/contractClose/closeContract',
        data: params,
        method: 'post'
    })
};

// 发起溢缴款校验
export const startOverflow = (params) => {
    return axios.request({
        url: '/contractManage/contractClose/startOverflow',
        data: params,
        method: 'post'
    })
};
